(function (global, context) {
    var helper = function () {
        return this;
    };
    helper.prototype = {
        each: function (array, method) {
            if (!array) {
                return this;
            }
            var length = array.length;
            if (!this.isPosInt(length)) {
                return this;
            }
            if (!this.isFunction(method)) {
                return this;
            }
            var result = undefined;
            for (var i = 0; i < length; i++) {
                result = method.call(this, i, array[i]);
                if (result === false) {
                    break;
                }
            }
            return this;
        },
        forEach: function (object, method) {
            if (!object) {
                return this;
            }
            if (!this.isFunction(method)) {
                return this;
            }
            var result = undefined;
            for (var i in object) {
                result = method.call(this, i, object[i]);
                if (result === false) {
                    break;
                }
            }
            return this;
        },
        isFunction: function (value) {
            if (!value) {
                return false;
            }
            var result = typeof value;
            return result == 'function';
        },
        isInteger: function (value) {
            if (!this.isNumber(value)) {
                return false;
            }
            var result = value | 0x0;
            return result == value;
        },
        isNatural: function (value) {
            if (!this.isInteger(value)) {
                return false;
            }
            return value >= 0;
        },
        isNullOrEmpty: function (value) {
            if (!value) {
                return true;
            }
            if (typeof value == 'string') {
                return value.length < 1;
            }
            if (value instanceof global.String) {
                return value.length < 1;
            }
            return true;
        },
        isNumber: function (value) {
            if (value === 0) {
                return true;
            }
            if (!value) {
                return false;
            }
            var result = typeof value;
            return result == 'number';
        },
        isPosInt: function (value) {
            if (!this.isInteger(value)) {
                return false;
            }
            return value > 0;
        },
        isPositive: function (value) {
            if (!this.isNumber(value)) {
                return false;
            }
            return value > 0;
        }
    };
    if (!global.xskin) {
        global.xskin = new global.Object();
    }
    global.xskin.helper = new helper();
})(window, window.document);